]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Don't inhibit suspend during initial setup
authorMatthew Leeds <matthew.leeds@endlessm.com>
Fri, 24 Apr 2020 21:42:52 +0000 (14:42 -0700)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 24 Apr 2020 23:47:31 +0000 (23:47 +0000)
Normally, we inhibit suspend while locking the screen. But in the
session mode used for gnome-initial-setup locking is not supported, so
in that case this inhibit call is pointless and should be avoided.
Without this patch you get the following error when you suspend and
resume during initial setup:

JS ERROR: Error getting systemd inhibitor: Gio.IOErrorEnum:
GDBus.Error:org.freedesktop.login1.OperationInProgress: The operation
inhibition has been requested for is already running
_promisify/proto[asyncFunc]/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:435:45

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1213

js/ui/screenShield.js

index ab75577fa98070b48efa2e24c52672fcc14fa516..b368162ce85c8bc5c13cd317ec2a08dd81854c33 100644 (file)
@@ -198,7 +198,7 @@ var ScreenShield = class {
         let lockEnabled = this._settings.get_boolean(LOCK_ENABLED_KEY);
         let lockLocked = this._lockSettings.get_boolean(DISABLE_LOCK_KEY);
         let inhibit = this._loginSession && this._loginSession.Active &&
-                       !this._isActive && lockEnabled && !lockLocked;
+                       !this._isActive && lockEnabled && !lockLocked && Main.sessionMode.unlockDialog;
         if (inhibit) {
             this._loginManager.inhibit(_("GNOME needs to lock the screen"),
                 inhibitor => {